import { isIOS } from '@vueuse/core'

const checkPhone = (() => {
    let b = false
    const mobile = navigator.userAgent.match(/(phone|pad|pod|iPhone|iPod|ios|iPad|Android|Mobile|BlackBerry|IEMobile|MQQBrowser|JUC|Fennec|wOSBrowser|BrowserNG|WebOS|Symbian|Windows Phone)/i)
    mobile != null
    var u = navigator.userAgent
    var isAndroid = u.indexOf('Android') > -1 || u.indexOf('Adr') > -1 //android终端
    var isiOS = !!u.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/) //ios终端
    let device = 0
    if (isAndroid) {
        device = 1 //android
    }
    if (isiOS) {
        device = 2 //ios
    }
    
    if (device != 0) b = true
    return b
})()
export default checkPhone